//
//  InternationalMediationCell.m
//  PASystem
//
//  Created by 刘沿 on 16/8/17.
//  Copyright © 2016年 czd. All rights reserved.
//

#import "InternationalMediationCell.h"

@implementation InternationalMediationCell

+(instancetype)WithInternationalMediationCell{

    return [[[NSBundle mainBundle] loadNibNamed:@"InternationalMediationCell" owner:nil options:nil] lastObject];

}

- (void)setModel:(MediationModel *)model{

    _model = model;

    self.PROPOSER.text = model.PROPOSER;
    self.TYPE.text = model.TYPE;
    
    //时间戳转时间
    NSString *string = model.APPLYTIME;
    NSDateFormatter *fmt = [[NSDateFormatter alloc] init];
    fmt.dateFormat = @"MMM d, yyyy HH:mm:ss aa";
    fmt.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en-US"];
    NSDate *date = [fmt dateFromString:string];
    NSDateFormatter *fm = [[NSDateFormatter alloc] init];
    fm.dateFormat = @"yyyy-MM-dd";
    NSString *selfYear = [fm stringFromDate:date];
    self.APPLYTIME.text = selfYear;
    
    if ([model.REPLY isEqualToString:@"0"]) {
        
        self.REPLY.text = @"未报批";
        
    }else if ([model.REPLY isEqualToString:@"1"]){
        self.REPLY.text = @"审批中";

        
    }else if ([model.REPLY isEqualToString:@"2"]){
        self.REPLY.text = @"审批通过";
        
    }else{
        self.REPLY.text = @"审批未通过";
        
    }
    

}


@end
